package com.netease.nim.demo.session.viewholder;

import android.text.method.LinkMovementMethod;
import android.text.style.ImageSpan;
import android.widget.ImageView;
import android.widget.TextView;

import com.netease.nim.demo.NimCache;
import com.netease.nim.demo.session.emoji.MoonUtil;
import com.shwread.android.qysw10000182.R;

public class MsgViewHolderTextLeft extends MsgViewHolder {

	protected TextView textMessageTextView;
	protected ImageView textMessageImageView;

	@Override
	protected int getResId() {
		return R.layout.text_message_view_left_item;
	}

	@Override
	protected int getViewHolderDirection() {
		return VIEW_HOLDER_LEFT;
	}

	@Override
	protected void inflate() {
		super.inflate();
		textMessageTextView = (TextView) view.findViewById(R.id.textViewTextMessage);
		textMessageTextView.setMovementMethod(LinkMovementMethod.getInstance());
		textMessageImageView = (ImageView) view.findViewById(R.id.textViewGuessMessage);
		longClickView = textMessageTextView;
	}

	@Override
	protected void refresh(Object item) {
		super.refresh(item);
		MoonUtil.identifyFaceExpression(NimCache.getContext(), textMessageTextView, messageItem.getMessage()
				.getContent(), ImageSpan.ALIGN_BOTTOM);
	}

}
